#pragma once

#ifdef GK_DEVICE_OPENGL

#include <map>

namespace gk
{
	class DeviceOpenGL : public DeviceCommon
	{
	public:

		void 				Initialise(InitParamsHandle hInitParams);
		void 				Shutdown();
		bool 				Present();

		// Object creation
		void				CreateContext(ContextHandle hContext);
		void				CreateBuffer(BufferHandle hBuffer);
		void				CreateRenderTarget(RenderTargetHandle hRenderTarget);
		void				CreateRenderSurface(RenderSurfaceHandle hRenderSurface);
		void				CreateTexture(TextureHandle hTexture);
		void				CreateStreamDescription(StreamDescriptionHandle hStreamDescription);
		void				CreateRenderBinding(RenderBindingHandle hRenderBinding);
		void				CreateGpuProgram(GpuProgramHandle hGpuProgram);
		void				CreateStateBlock(StateBlockHandle hStateBlock);
		void				CreateConstantBuffer(ConstantBufferHandle hConstantBuffer);

		// Object destruction
		void				ReleaseContext(ContextHandle hContext);
		void				ReleaseBuffer(BufferHandle hBuffer);
		void				ReleaseRenderTarget(RenderTargetHandle hRenderTarget);
		void				ReleaseRenderSurface(RenderSurfaceHandle hRenderSurface);
		void				ReleaseTexture(TextureHandle hTexture);
		void				ReleaseStreamDescription(StreamDescriptionHandle hStreamDescription);
		void				ReleaseRenderBinding(RenderBindingHandle hRenderBinding);
		void				ReleaseGpuProgram(GpuProgramHandle hGpuProgram);
		void				ReleaseStateBlock(StateBlockHandle hStateBlock);
		void				ReleaseConstantBuffer(ConstantBufferHandle hConstantBuffer);

	private:

		HDC					m_hDC;
		HGLRC				m_hRC;

		cr::size_t			m_maxColourTargets;

		bool				SupportsExtension( const char* szExtensionName );
	};
}

#endif // GK_DEVICE_OPENGL